
#ifndef __timer_objectH__
#define __timer_objectH__

#include "kernel.h"

namespace WtfEngine {
	class Timer: public FrameStartEvent {
		IAppState::tWeakRef mrState;
		IFunctor<>::tRef mrFunc;
		tGameTime mTimer, mStartTime;
		bool mbOneShot;

	public:
		Timer(IAppState::tWeakRefa rState, IFunctor<>::tRefa rFunc, tGameTime tmo, bool bOneShot = true);

		void Destroy();

	private:
		void OnFrameStart();

		GC_AUTOSIZE(Timer);
	};
};

#endif
